package com.jml.service;

import com.jml.entity.GateWayEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class ApiGatewayService {

    @Autowired
    private JmlGatewayService jmlGatewayService;

    @RequestMapping("/deleteGateway")
    public String deleteGateway(String routeId) {
        jmlGatewayService.deleteConfig(routeId);
        return "ok";
    }

    @RequestMapping("/addGateway")
    public String addGateway(@RequestBody GateWayEntity gateWayEntity) {
        jmlGatewayService.addConfig(gateWayEntity);
        return "ok";
    }
}
